<template>
  <div class="child">
    <h2>父给的性别：{{ gender }}</h2>
    男<input 
        type="radio" 
        name="sex" 
        :checked="gender === 'male'"
        @change="updateGender('male')"
      > 
    女<input 
        type="radio" 
        name="sex"
        :checked="gender === 'female'"
        @change="updateGender('female')"
      >
  </div>
</template>

<script>
  export default {
    name:'Child',
    props:['gender','updateGender']
  }
</script>

<style scoped>
  /* 此处写样式 */
  .child {
    margin-top: 10px;
    background-color: skyblue;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
</style>